package com.newray.base.service.impl;

import javax.sql.DataSource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.newray.base.dao.UserDao;
import com.newray.base.model.TUserinfo;
import com.newray.base.service.UserService;
import com.newray.base.spring.SpringContextHolder;
import com.newray.base.web.command.LoginCommand;

@Service("userService")
public class UserServiceImpl implements UserService {
	private UserDao userDao;
	
	@Transactional
	public TUserinfo login(LoginCommand comm) {
		DataSource ds = (DataSource) SpringContextHolder.getBean("dataSource",
				DataSource.class);

		TUserinfo user = userDao.find("201207041303182470000");

		return user;
	}

	@Autowired
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}
}